<%--
  Created by IntelliJ IDEA.
  User: 娅娅
  Date: 2021/6/21
  Time: 17:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>水果信息表</title>
</head>
<body>
<table border="1">
    <tr>
        <th align="center">类别</th>
        <th align="center">品种</th>
        <th align="center">产地</th>
        <th align="center">总重量（公斤）</th>
        <th align="center">单价（元/公斤）</th>
        <th align="center">操作</th>
    </tr>
    <c:forEach var="f" items="${list}" varStatus="fruit">
        <tr <c:if test="${fruit.index % 2==0}">style="background: antiquewhite" </c:if>>
            <td>${f.type}</td>
            <td>${f.breed}</td>
            <td>${f.area}</td>
            <td>${f.weight}</td>
            <td>${f.price}</td>
            <td><a href="FruitServlet?fruitId=${f.fruitId}">详情</a>&nbsp;&nbsp;
                <a href="FruitDelServlet?fruitId=${f.fruitId}" >删除</a>&nbsp;&nbsp;
                <a href="fruitAdd.jsp">新增</a>&nbsp;&nbsp;
                <a href="FruitServlet?fruitId=${f.fruitId}">修改</a>
            </td>
        </tr>
    </c:forEach>
</table>
<p>${info}</p>
<p>
    <a href="FruitListServlet?pageNo=${pageNo}">首页</a>
    <c:if test="${pageNo>1}">
        <a href="FruitListServlet?pageNo=${pageNo-1}">上一页</a>
    </c:if>
    <a href="FruitListServlet?pageNo=${pageNo+1}">下一页</a>
</p>
</body>
</html>
